<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>observer-model</title>
	</head>
	<body>
		<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.3.0/jquery.js"></script>
		<script type="text/javascript">
			// 启动步骤:
			//	1.打开当前目录
			//	2.http-server -p 8881
			//	3.localhost:8881/observer-model.html
			
			
			// 场景: jQuery $.Callbacks() // 注意首字母大写
			var callbacks = $.Callbacks();
			callbacks.add(function(info) {
				console.log('fn1', info)
			})
			callbacks.add(function(info) {
				console.log('fn2', info)
			})
			callbacks.add(function(info) {
				console.log('fn3', info)
			})
			
			callbacks.fire('hello');
			callbacks.fire('world')
		</script>
	</body>
</html>